<div class="easyui-layout" data-options="fit:true">
    <form id="editFrom" method="post">
        <input type="hidden" name="id" id="faqId">、
        <div data-options="region:'center'">
            <div class="easyui-tabs">
                <div title="问题信息">
                    <table class="inputTable">
                        <tr>
                            <td>问题栏目</td>
                            <td><input class="easyui-combobox" name="faqType.id" required
                                       data-options="valueField:'id' , url:'/faqtype/types'" missingMessage="请选择问题栏目">
                                <span style="color: red;">*</span>
                            </td>
                        </tr>
                        <tr>
                            <td>状态</td>
                            <td>
                                <input style="width: auto" type="radio" name="state" value="01">发布</input>
                                <input style="width: auto" type="radio" name="state" value="02" checked>草稿</input>
                            </td>
                        </tr>
                        <tr>
                            <td>问题标题</td>
                            <td><input name="title" class="easyui-validatebox" data-options="required:true"
                                       maxlength="50" missingMessage="请输入问题标题">
                                <span style="color: red;">*</span>
                            </td>
                        </tr>
                        <tr>
                            <td>问题内容</td>
                            <td>
                                <script id="container" name="preview" type="text/plain"></script>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </form>
    <div data-options="region:'south',border:false" style="text-align:right;padding:5px">
        <a class="easyui-linkbutton update" data-options="iconCls:'fa fa-save'" href="javascript:;"
           style="width:80px">更新</a>
        <a class="easyui-linkbutton" data-options="iconCls:'fa fa-close '" href="javascript:;"
           onclick="javascript:$('#win').window('close')" style="width:80px">取消</a>
    </div>
</div>
<script type="text/javascript" src="/static/webuploader-0.1.5/bdup.js"></script>
<script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/static/ueditor/ueditor.all.js"></script>
<script>
    var ue = UE.getEditor('container', {
        toolbars: [[
            'undo', //撤销
            'redo', //重做
            'bold', //加粗
            'indent', //首行缩进
            'italic', //斜体
            'underline', //下划线
            'strikethrough', //删除线
            'subscript', //下标
            'fontborder', //字符边框
            'superscript', //上标
            'formatmatch', //格式刷
            'blockquote', //引用
            'pasteplain', //纯文本粘贴模式
            'selectall', //全选
            'print', //打印
            'preview', //预览
            'horizontal', //分隔线
            'removeformat', //清除格式
            'time', //时间
            'date', //日期
            'fontfamily', //字体
            'fontsize', //字号
            'paragraph', //段落格式
            'simpleupload', //单图上传
            'link', //超链接
            'spechars', //特殊字符
            'searchreplace', //查询替换
            'insertvideo', //视频
            'justifyleft', //居左对齐
            'justifyright', //居右对齐
            'justifycenter', //居中对齐
            'justifyjustify', //两端对齐
            'forecolor', //字体颜色
            'backcolor', //背景色
            'fullscreen', //全屏
            'directionalityltr', //从左向右输入
            'directionalityrtl', //从右向左输入
            'rowspacingtop', //段前距
            'rowspacingbottom', //段后距
            'pagebreak', //分页
            'attachment', //附件
            'lineheight', //行间距
            'edittip ', //编辑提示
            'customstyle', //自定义标题
            'autotypeset', //自动排版
            'touppercase', //字母大写
            'tolowercase', //字母小写
            'background', //背景
            'template', //模板
        ]],
        //focus时自动清空初始化时的内容
        autoClearinitialContent: true,
        //关闭字数统计
        wordCount: false,
        //关闭elementPath
        elementPathEnabled: false,
        initialFrameHeight: 310,
        initialFrameWidth: 795,
        //高度固定
        autoHeightEnabled: false
        //更多其他参数，请参考ueditor.config.js中的配置项
    });

    ue.ready(function () {
        var faqId = $("#faqId").val();
        $.get(edit, {id: faqId}, function (msg) {
            if (msg.state == "SUCCESS") {
                var data = msg.data.preview;
                //异步回调
                ue.execCommand('insertHtml', data);

                $.each($("#editFrom").find(".easyui-combobox"), function (i, v) {
                    var name = $(v).attr("textboxname");
                    $(v).combobox('setValue', eval("msg.data." + name));
                });

            } else {
                $.messager.show({
                    title: '操作提示',
                    msg: msg.message,
                    timeout: 2000,
                    showType: 'slide'
                });
            }
        })

    });

</script>
